package com.winit.common.rabbitSend;

import com.alibaba.fastjson.JSONObject;
import com.winit.commons.util.ObjectToString;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * Created by wanglin on 2018/6/12.
 */
@Component
public class MsgSend {
    @Autowired
    private AmqpTemplate rabbitTemplate;

    @Value("${cloudLink_send_exchange}")
    private String cloudLink_send_exchange;


    public void sendMsg(JSONObject jsonObject){
        this.rabbitTemplate.convertAndSend(cloudLink_send_exchange, "#-msg-queue", jsonObject);
    }
}
